package com.cyj.springbootredis.messageHand;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

/**
 * @description:
 * @Author C_Y_J
 * @create 2022/7/5 9:24
 **/
@Slf4j
@Component
public class MessageSubscriber {

    @Autowired
    private RedisTemplate redisTemplate;

    public void onMessage(Object message, String pattern) {
        log.info("请求参数:{}", message);

        // 将从channel拿到的message进行json转换为对象

        // 做业务逻辑 ...

    }
}
